package com.seu.spring.simple.ioc;

import com.seu.spring.bean.Car;
import com.seu.spring.bean.Wheel;
import org.junit.Test;

/**
 * Test simple IOC
 *
 * @author liangfeihu
 * @since 2018/12/27
 */
public class SimpleIOCTest {

    @Test
    public void getBean() throws Exception {
        ClassLoader classLoader = SimpleIOC.class.getClassLoader();
        String location = classLoader.getResource("simplespring/ioc.xml").getFile();
        SimpleIOC bf = new SimpleIOC(location);
        Wheel wheel = (Wheel) bf.getBean("wheel");
        System.out.println(wheel);
        Car car = (Car) bf.getBean("car");
        System.out.println(car);
    }

}
